<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/12/7
 * Time: 10:32
 */
require_once "userTool.php";

$username = $_POST["username"];
$password = $_POST["password"];

$userId = checkId($username,$password);
setcookie("userId",md5($userId),time()+24*3600,"/");

session_start();
$_SESSION[md5($userId)]= $userId;

echo "登陆成功<br><a href='user.php'>欢迎进入用户中心</a>";